package com.atguigu.tingshu.album.mapper;

import com.atguigu.tingshu.model.album.TrackStat;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface TrackStatMapper extends BaseMapper<TrackStat> {

    @Select("update track_stat set stat_num=stat_num+#{count} where track_id=#{trackId} and stat_type=#{statType} and is_deleted=0")
    void updateTrackStat(@Param("statType") String statType,@Param("trackId") Long trackId,@Param("count") Integer count);
}
